<template>
  <div class="font-14px box-sizing bg-img-gp " style=" ;background-color: #d60a22"  >
    <div class="w-full bg-f" style="height: 40px ;display: flex; justify-content: right ; align-items: center ;">
      <TradeDateModel type="info" icon="el-icon-search" size="mini"  class="dis-lb"
                      @confirmTradeDate="confirmTradeDate" >同步数据</TradeDateModel>
    </div>
    <div style="display: flex ; justify-content: center ; align-items: center ; height: calc(100vh - 40px); width: 100vw" class="bg-f6">
      <v2-main class="bg-f" style="width:80vw ; height: 85vh ;">
        <el-container style=" height: 100%;" class="bg-img-gp">
          <el-aside width="200px"  style=" height: 100% ;overflow: auto">
            <div class="aside-title text-center bg-img-gp2 font-16px " style="color: #d60a22;font-weight: bold">挣它一个亿</div>
            <el-menu :default-active="gpActive" class="cfy-menu">
              <el-menu-item class="sider-nav-item list-item"
                            :index="item.url"
                            v-for="(item , index) in menus"  @click="open(item.url)">
                <span>{{item.name}}</span>
              </el-menu-item>
            </el-menu>
          </el-aside>
          <el-container >
            <el-main >
              <div  class="pd-10px"><router-view /></div>
            </el-main>
          </el-container>
        </el-container>
      </v2-main>
    </div>

  </div>

</template>
<script>
import dialogForm from "@/components/v2-form/dialogForm";
import Constants from '@/Constants'
import v2Main from "@/components/v2-cps/v2-main";
import v2Header from "@/components/v2-cps/v2-header";
import dir from "@/api/learn/dir"
import books from "api/learn/books" ;
import ApiResponse from "utils/ApiResponse";
import util from "utils/util";
import Service from "api/Service";
import {mapGetters} from "vuex";
import store from "@/store";
import http from "network/http";
export default {
  name: 'index',
  components:{

  } ,
  data(){
    return {
      bookActiveIndex: "0" ,
      menus:[
        {
          name: '政策/利好',
          url: '/gp/policy'
        },
        {
          name: '新闻',
          url: '/gp/news'
        },
        {
          name: '主块',
          url: '/gp/main'
        },
        {
          name: '每日指标',
          url: '/gp/day/dailyIndicators'
        },
        {
          name: '资金流向',
          url: '/gp/capital/flow/stock'
        },

        {
          name: '游资交易数据',
          url: '/gp/capital/flow/hotMoney'
        },
        {
          name: '股票列表',
          url: '/gp/aStock'
        },
        {
          name: '今日竞价',
          url: '/gp/stockBidding'
        },
        {
          name: '股票曾用明',
          url: '/gp/gpHistoryName'
        }
      ] ,

    }
  },
  created() {
    this.getNewTradeDate()
  },
  mounted(){

  },
  methods:{
    getNewTradeDate(){
      http.post("/xcdhTrading/stock-info/newTradeDate").then(res=>{
        this.formData.tradeDate = res.data.tradeDate
        this.tradeDateCode = res.data.tradeDateCode
      })
    },
    confirmTradeDate(tradeDate){
      if(!tradeDate){
        this.$message.error('请选择时间');
        return
      }
      http.post(`/xcdhTrading/sync/all/syncAllTrData/${tradeDate}`).then(res=>{

      })
    },
    open(url){
      this.$router.replace(url)
      store.commit(Constants.setGpActive,url)
    }
  },
  computed:{
    gpActive(){
      return  this.$store.state.global.gpActive || "/gp/golpe";
    }

  },
  watch:{
  }
}
</script>

<style>
.cover{
  text-align: center;
  height: 119px;
}

.grid-content{
  box-shadow: 0 0 5px #00000024;
}
.cfy-menu .el-menu-item{
  height: 44px;
  line-height: 44px;
}
.el-aside{
  border-right: 1px solid #ddd;
}
.cfy-menu .el-menu-item.is-active{
  background-color: #d60a22;
  color: #fff;
}
.cfy-menu{border-right: none !important;}
.aside-title{
  height: 44px;
  border-bottom: 1px solid #eee;
}

.cfy-menu .el-menu-item.is-active .el-icon-more{
  color: #fff;
}
.c-btn{
  padding: 6px 16px;
  margin: 0 10px;
}
.el-menu{
  background-color: rgba(0,0,0,0);
}
</style>
